//
//  ICAsyncSocketManager.h
//  ICome
//
//  Created by zhangrongwu on 16/3/14.
//  Copyright © 2016年 iCom. All rights reserved.
//  长连接管理

#import <Foundation/Foundation.h>
@protocol ICAsyncSocketManagerDelegate <NSObject>

@end

typedef void(^RConnetSuccessBlock)();
typedef void(^RConnetFailureBlock)();

@interface ICAsyncSocketManager : NSObject

@property (nonatomic, weak)id <ICAsyncSocketManagerDelegate> delegate;

@property (nonatomic, assign) int status;   //connect status：1 connect，-1 not connect，0 connecting

/**
 *  sharedInstance
 */
+ (ICAsyncSocketManager *)sharedInstance;

/**
 *  init socket
 */
- (void)initSocket;

/**
 *  disconnect socket
 */
- (void)disconnectSocket;

/**
 *  reconnection socket have block
 */
- (void)reconnectionSuccess:(RConnetSuccessBlock)success
                    Failure:(RConnetFailureBlock)failure;
/**
 *  fail request re_send
 */
- (void)reSendRequest;
/** 
 * isconnect
 */
- (BOOL)isConnected;

/**
 *  about business socketrequest
 */
//- (void)socketRequestWithParam:(id)param;
/**
 *  new tcp request
 */
- (void)socketRequestWithRequestBody:(id)body requestTag:(NSInteger)tag;

@end



